11 research outputs found
Faithful (meta-)encodings of programmable strategies into term rewriting systems
Rewriting is a formalism widely used in computer science and mathematical
logic. When using rewriting as a programming or modeling paradigm, the rewrite
rules describe the transformations one wants to operate and rewriting
strategies are used to con- trol their application. The operational semantics
of these strategies are generally accepted and approaches for analyzing the
termination of specific strategies have been studied. We propose in this paper
a generic encoding of classic control and traversal strategies used in rewrite
based languages such as Maude, Stratego and Tom into a plain term rewriting
system. The encoding is proven sound and complete and, as a direct consequence,
estab- lished termination methods used for term rewriting systems can be
applied to analyze the termination of strategy controlled term rewriting
systems. We show that the encoding of strategies into term rewriting systems
can be easily adapted to handle many-sorted signa- tures and we use a
meta-level representation of terms to reduce the size of the encodings. The
corresponding implementation in Tom generates term rewriting systems compatible
with the syntax of termination tools such as AProVE and TTT2, tools which
turned out to be very effective in (dis)proving the termination of the
generated term rewriting systems. The approach can also be seen as a generic
strategy compiler which can be integrated into languages providing pattern
matching primitives; experiments in Tom show that applying our encoding leads
to performances comparable to the native Tom strategies
Machines abstraites non déterministes
We present a generic design of abstract machines for nondeterministic programming languages, such as process calculi or concurrent lambda calculi, that provides a simple way to implement them. Such a machine traverses a term in the search for a redex, making non-deterministic choices when several paths are possible and backtracking when it reaches a dead end, i.e., an irreducible subterm. The search is guaranteed to terminate thanks to term annotations the machine introduces along the way. We show how to automatically derive a non-deterministic abstract machine from a zipper semantics-a form of structural operational semantics in which the decomposition process of a term into a context and a redex is made explicit. The derivation method ensures the soundness and completeness of the machines w.r.t. the zipper semantics.Nous proposons une présentation uniforme des machines abstraites pour les langages non déterministes, tels que les calculs de processus ou les lambda-calculs concurrents, qui permet de les implémenter facilement. Une telle machine traverse le terme à la recherche d’un redex, en faisant des choix arbitraires lorsque plusieurs chemins sont possibles, et en retournant en arrière lorsqu’elle atteint un cul-de-sac, c’est-à -dire un terme irreductible. Nous garantissons la terminaison de la recherche grâce aux annotations que la machine ajoute encours de route. Nous montrons comment dériver automatiquement une machine non déterministe depuis une sémantique zipper—une forme de sémantique opérationnelle structurelle dans laquelle la décomposition d’un terme en un contexte et un redex apparaît explicitement. La méthode dedérivation garantit la correction et la complétude de la machine par rapport à la sémantique zipper
2015 Workshop on Continuations: pre-proceedings
This volume contains the papers presented at WoC 2015, the 2015 Workshopon Continuations held on April 12, 2015 in London, UK
A practical type system for generalized recursion
The ML language is equipped with a sophisticated module system, especially thanks to its notions of functor (higher-order functions on modules) and of controlled type abstraction (opaque or transparent types). Nevertheless, an important weakness of this system hinders modularization: the impossibility to define mutually recursive modules. In particular, mutually recursive functions must all reside in the same module. Recently, Leroy extended the OCaml language, a dialect of ML, with an unsafe notion of recursive modules. In this extension, one can define recursive modules, but the system does not check that they are well-founded. If not, the system throws an exception at runtime, which is annoying given the strong typing of ML. Powerful type systems have been proposed to tackle this issue, but they require rather deep modifications to the ML type system. This report presents a system requiring only local modifications to the ML type system. We prove its soundness by injection into one of the evoked more general formalisms.Le langage ML est doté d'un système de modules sophistiqué, notamment grâce aux foncteurs (fonctions d'ordre supérieur sur les modules) et à son mécanisme d'abstraction de types contrôlée (types manifestes ou abstraits). Cependant, une faiblesse importante de ce système gêne la modularisation des programmes : l'impossibilité de définir des modules de façon mutuellement récursive. Notamment, les définitions de fonctions mutuellement récursives doivent toutes résider dans le même module. Récemment, Leroy a étendu le langage OCaml, un dialecte de ML, avec une notion non sûre de modules récursifs. Avec cette extension, on peut définir des modules récursifs, mais le système ne vérifie pas que ces définitions sont bien fondées. Lorsqu'elles ne le sont pas, le système lance une exception à l'exécution, ce qui cadre mal avec le typage fort de ML. Des systèmes de types assez généraux ont été proposés récemment pour gérer ce problème, mais leur mise en oeuvre demande une modification en profondeur du typage de ML. Ce rapport propose un système ne nécessitant que des modifications locales au typage de ML. Nous prouvons sa sûreté par injection dans l'un des formalismes plus généraux évoqués ci-dessus
Non-Deterministic Abstract Machines
We present a generic design of abstract machines for nondeterministic programming languages, such as process calculi or concurrent lambda calculi, that provides a simple way to implement them. Such a machine traverses a term in the search for a redex, making non-deterministic choices when several paths are possible and backtracking when it reaches a dead end, i.e., an irreducible subterm. The search is guaranteed to terminate thanks to term annotations the machine introduces along the way. We show how to automatically derive a non-deterministic abstract machine from a zipper semantics-a form of structural operational semantics in which the decomposition process of a term into a context and a redex is made explicit. The derivation method ensures the soundness and completeness of the machines w.r.t. the zipper semantics
Machines abstraites non déterministes
We present a generic design of abstract machines for nondeterministic programming languages, such as process calculi or concurrent lambda calculi, that provides a simple way to implement them. Such a machine traverses a term in the search for a redex, making non-deterministic choices when several paths are possible and backtracking when it reaches a dead end, i.e., an irreducible subterm. The search is guaranteed to terminate thanks to term annotations the machine introduces along the way. We show how to automatically derive a non-deterministic abstract machine from a zipper semantics-a form of structural operational semantics in which the decomposition process of a term into a context and a redex is made explicit. The derivation method ensures the soundness and completeness of the machines w.r.t. the zipper semantics.Nous proposons une présentation uniforme des machines abstraites pour les langages non déterministes, tels que les calculs de processus ou les lambda-calculs concurrents, qui permet de les implémenter facilement. Une telle machine traverse le terme à la recherche d’un redex, en faisant des choix arbitraires lorsque plusieurs chemins sont possibles, et en retournant en arrière lorsqu’elle atteint un cul-de-sac, c’est-à -dire un terme irreductible. Nous garantissons la terminaison de la recherche grâce aux annotations que la machine ajoute encours de route. Nous montrons comment dériver automatiquement une machine non déterministe depuis une sémantique zipper—une forme de sémantique opérationnelle structurelle dans laquelle la décomposition d’un terme en un contexte et un redex apparaît explicitement. La méthode dedérivation garantit la correction et la complétude de la machine par rapport à la sémantique zipper
Machines abstraites non déterministes
We present a generic design of abstract machines for nondeterministic programming languages, such as process calculi or concurrent lambda calculi, that provides a simple way to implement them. Such a machine traverses a term in the search for a redex, making non-deterministic choices when several paths are possible and backtracking when it reaches a dead end, i.e., an irreducible subterm. The search is guaranteed to terminate thanks to term annotations the machine introduces along the way. We show how to automatically derive a non-deterministic abstract machine from a zipper semantics-a form of structural operational semantics in which the decomposition process of a term into a context and a redex is made explicit. The derivation method ensures the soundness and completeness of the machines w.r.t. the zipper semantics.Nous proposons une présentation uniforme des machines abstraites pour les langages non déterministes, tels que les calculs de processus ou les lambda-calculs concurrents, qui permet de les implémenter facilement. Une telle machine traverse le terme à la recherche d’un redex, en faisant des choix arbitraires lorsque plusieurs chemins sont possibles, et en retournant en arrière lorsqu’elle atteint un cul-de-sac, c’est-à -dire un terme irreductible. Nous garantissons la terminaison de la recherche grâce aux annotations que la machine ajoute encours de route. Nous montrons comment dériver automatiquement une machine non déterministe depuis une sémantique zipper—une forme de sémantique opérationnelle structurelle dans laquelle la décomposition d’un terme en un contexte et un redex apparaît explicitement. La méthode dedérivation garantit la correction et la complétude de la machine par rapport à la sémantique zipper